/*     */ package com.lmpop.trade.ti_normal_biz;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.FileIO;
/*     */ import com.lmpop.trade.ti_inquiry.Ti_inquiryInfo;
/*     */ import com.lmpop.trade.ts_module.Ts_moduleInfo;
/*     */ import com.lmpop.updateHtml.parseXml.Config;
/*     */ import com.lmpop.updateHtml.updateHtml.UpdateArticleHtml;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_normal_bizInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */   FileIO io;
/*     */   Config conf;
/*     */   String rootpath;
/*     */   UpdateArticleHtml uah;
/*     */ 
/*     */   public Ti_normal_bizInfo()
/*     */   {
/*  25 */     this.queryList = new QueryList();
/*  26 */     this.uah = new UpdateArticleHtml();
/*  27 */     this.io = new FileIO();
/*  28 */     this.conf = new Config();
/*  29 */     this.conf.init();
/*  30 */     this.rootpath = this.conf.getString("rootpath");
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  40 */     Ti_normal_biz ti_normal_biz = new Ti_normal_biz();
/*  41 */     String share = "0";
/*  42 */     if (map.getString("rsrv_str5").equals("1")) share = "1";
/*     */ 
/*  44 */     ti_normal_biz.setBiz_id(map.getString("biz_id"));
/*  45 */     ti_normal_biz.setCust_id(map.getString("cust_id"));
/*  46 */     ti_normal_biz.setBiz_type(map.getString("biz_type"));
/*  47 */     ti_normal_biz.setTitle(map.getString("title"));
/*  48 */     ti_normal_biz.setContent(map.getString("content"));
/*  49 */     ti_normal_biz.setBiz_price(map.getString("biz_price"));
/*  50 */     ti_normal_biz.setCurrency(map.getString("currency"));
/*  51 */     ti_normal_biz.setEnd_date(map.getString("end_date"));
/*  52 */     ti_normal_biz.setPack_type(map.getString("pack_type"));
/*  53 */     ti_normal_biz.setMini_supply(map.getString("mini_supply"));
/*  54 */     ti_normal_biz.setMax_supply(map.getString("max_supply"));
/*  55 */     ti_normal_biz.setMarket_type(map.getString("market_type"));
/*  56 */     ti_normal_biz.setUnits(map.getString("units"));
/*  57 */     ti_normal_biz.setTransaction_mode(map.getString("transaction_mode"));
/*  58 */     ti_normal_biz.setDelivery_date(map.getString("delivery_date"));
/*  59 */     ti_normal_biz.setLogistics(map.getString("logistics"));
/*  60 */     ti_normal_biz.setWholesale(map.getString("wholesale"));
/*  61 */     ti_normal_biz.setProduct_spec(map.getString("product_spec"));
/*  62 */     ti_normal_biz.setCertify_req(map.getString("certify_req"));
/*  63 */     ti_normal_biz.setClass_attr(map.getString("class_attr"));
/*  64 */     ti_normal_biz.setArea_attr(map.getString("area_attr"));
/*  65 */     ti_normal_biz.setAttr_desc(map.getString("attr_desc"));
/*  66 */     ti_normal_biz.setState_code(map.getString("state_code"));
/*     */ 
/*  68 */     ti_normal_biz.setSale_spec(map.getString("sale_spec"));
/*  69 */     ti_normal_biz.setQua_date(map.getString("qua_date"));
/*  70 */     ti_normal_biz.setRep_date(map.getString("rep_date"));
/*  71 */     ti_normal_biz.setPayments(map.getString("payid"));
/*  72 */     ti_normal_biz.setRsrv_str5(share);
/*  73 */     ti_normal_biz.setRsrv_str3(map.getString("rsrv_str3"));
/*  74 */     ti_normal_biz.setRsrv_str4(map.getString("rsrv_str4"));
/*  75 */     ti_normal_biz.setRsrv_str6(map.getString("rsrv_str6"));
/*  76 */     ti_normal_biz.setUser_id(map.getString("user_id"));
/*  77 */     ti_normal_biz.setRemark(map.getString("remark"));
/*     */ 
/*  79 */     String result_code = "0";
/*     */     try {
/*  81 */       insert(dbmMgr, ti_normal_biz);
/*     */     } catch (ApplicationException e) {
/*  83 */       e.printStackTrace();
/*  84 */       result_code = "1";
/*     */     }
/*  86 */     map.setString("result_code", result_code);
/*  87 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_normal_biz ti_normal_biz)
/*     */     throws ApplicationException
/*     */   {
/*  96 */     dbmMgr.update("insertTi_normal_biz", ti_normal_biz);
/*     */   }
/*     */   public SysMap create_alterPage(DbmInterf dbmMgr, SysMap map) {
/*  99 */     if (map.getString("biz_type").equals("f"))
/*     */     {
/* 101 */       this.uah.updateArticleByGoodsId("ljc8k4Rldfas5yf", map.getString("biz_id"), "0", "1");
/*     */     }
/* 103 */     if (map.getString("biz_type").equals("1"))
/*     */     {
/* 105 */       this.uah.updateArticleByGoodsId("ljc8k4RlQ34m5y1", map.getString("biz_id"), "0", "1");
/*     */     }
/* 107 */     if (map.getString("biz_type").equals("2"))
/*     */     {
/* 109 */       this.uah.updateArticleByGoodsId("ljc8k4Rldf4m5y2", map.getString("biz_id"), "0", "1");
/*     */     }
/* 111 */     return map;
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 120 */     String pkid_string = map.getString("pkid");
/* 121 */     String result_code = "0";
/* 122 */     Ti_inquiryInfo inquiry = new Ti_inquiryInfo();
/* 123 */     Ts_moduleInfo moduleInfo = new Ts_moduleInfo();
/* 124 */     String modulepath = "";
/*     */     try {
/* 126 */       if (!pkid_string.equals("")) {
/* 127 */         String[] pkStr = pkid_string.split("\\|");
/* 128 */         List list = null;
/* 129 */         String publish_date = ""; String biz_type = "";
/* 130 */         for (int i = 0; i < pkStr.length; i++)
/* 131 */           if (!pkStr[i].equals("")) {
/* 132 */             list = this.queryList.getList("getTi_normal_bizByPk", pkStr[i]);
/* 133 */             if ((list != null) && (list.size() > 0))
/*     */             {
/* 135 */               publish_date = ((Hashtable)list.get(0)).get("in_date").toString();
/* 136 */               biz_type = ((Hashtable)list.get(0)).get("biz_type").toString();
/*     */             }
/* 138 */             publish_date = publish_date.substring(0, 10);
/* 139 */             Hashtable inquirymap = new Hashtable();
/* 140 */             inquirymap.put("info_id", pkStr[i]);
/* 141 */             if (inquiry.getCountByObj(inquirymap) > 0)
/*     */             {
/* 143 */               map.setString("result_code", "1");
/* 144 */               map.setString("result_info", "5127-1");
/* 145 */               return map;
/*     */             }
/* 147 */             if (biz_type.equals("1"))
/*     */             {
/* 149 */               modulepath = moduleInfo.getSavaPathByCode("supply");
/*     */             }
/* 151 */             if (biz_type.equals("2"))
/*     */             {
/* 153 */               modulepath = moduleInfo.getSavaPathByCode("stock");
/*     */             }
/*     */ 
/* 156 */             delete(dbmMgr, pkStr[i]);
/*     */ 
/* 158 */             FileIO.DelFile(this.rootpath + modulepath + publish_date + "/" + pkStr[i] + ".html");
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e) {
/* 163 */       e.printStackTrace();
/* 164 */       result_code = "1";
/*     */     }
/* 166 */     map.setString("result_code", result_code);
/* 167 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 176 */     dbmMgr.update("deleteTi_normal_biz", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 186 */     Ti_normal_biz ti_normal_biz = new Ti_normal_biz();
/* 187 */     String share = "0";
/* 188 */     if (map.getString("rsrv_str5").equals("1")) share = "1";
/*     */ 
/* 191 */     ti_normal_biz.setBiz_id(map.getString("biz_id"));
/* 192 */     ti_normal_biz.setBiz_type(map.getString("biz_type"));
/* 193 */     ti_normal_biz.setTitle(map.getString("title"));
/* 194 */     ti_normal_biz.setContent(map.getString("content"));
/* 195 */     ti_normal_biz.setBiz_price(map.getString("biz_price"));
/* 196 */     ti_normal_biz.setCurrency(map.getString("currency"));
/* 197 */     ti_normal_biz.setEnd_date(map.getString("end_date"));
/* 198 */     ti_normal_biz.setPack_type(map.getString("pack_type"));
/* 199 */     ti_normal_biz.setMini_supply(map.getString("mini_supply"));
/* 200 */     ti_normal_biz.setMax_supply(map.getString("max_supply"));
/* 201 */     ti_normal_biz.setMarket_type(map.getString("market_type"));
/* 202 */     ti_normal_biz.setUnits(map.getString("units"));
/* 203 */     ti_normal_biz.setTransaction_mode(map.getString("transaction_mode"));
/* 204 */     ti_normal_biz.setDelivery_date(map.getString("delivery_date"));
/* 205 */     ti_normal_biz.setLogistics(map.getString("logistics"));
/* 206 */     ti_normal_biz.setWholesale(map.getString("wholesale"));
/* 207 */     ti_normal_biz.setProduct_spec(map.getString("product_spec"));
/* 208 */     ti_normal_biz.setCertify_req(map.getString("certify_req"));
/* 209 */     ti_normal_biz.setClass_attr(map.getString("class_attr"));
/* 210 */     ti_normal_biz.setAttr_desc(map.getString("attr_desc"));
/* 211 */     ti_normal_biz.setRsrv_str5(share);
/*     */ 
/* 214 */     ti_normal_biz.setRemark(map.getString("remark"));
/* 215 */     ti_normal_biz.setSale_spec(map.getString("sale_spec"));
/* 216 */     ti_normal_biz.setQua_date(map.getString("qua_date"));
/* 217 */     ti_normal_biz.setRep_date(map.getString("rep_date"));
/* 218 */     ti_normal_biz.setPayments(map.getString("payid"));
/* 219 */     String result_code = "0";
/*     */     try {
/* 221 */       update(dbmMgr, ti_normal_biz);
/*     */     }
/*     */     catch (ApplicationException e) {
/* 224 */       e.printStackTrace();
/* 225 */       result_code = "1";
/*     */     }
/* 227 */     map.setString("result_code", result_code);
/* 228 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_normal_biz ti_normal_biz)
/*     */     throws ApplicationException
/*     */   {
/* 237 */     dbmMgr.update("updateTi_normal_biz", ti_normal_biz);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 248 */     Map ti_normal_biz = (Hashtable)obj;
/* 249 */     if (start == 0)
/* 250 */       start = 0;
/*     */     else {
/* 252 */       start = (start - 1) * limit;
/*     */     }
/* 254 */     ti_normal_biz.put("start", Integer.valueOf(start));
/* 255 */     ti_normal_biz.put("limit", Integer.valueOf(limit));
/* 256 */     return this.queryList.getList("getListByTi_normal_bizPage", ti_normal_biz);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 268 */     Map ti_news = (Hashtable)obj;
/* 269 */     List list = this.queryList.getList("getCountByObjTi_normal_biz", ti_news);
/* 270 */     int count = 0;
/* 271 */     if ((list != null) && (list.size() > 0)) {
/* 272 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 273 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 274 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 277 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 287 */     return this.queryList.getList("getTi_normal_bizByPk", pk);
/*     */   }
/*     */ 
/*     */   public SysMap upateState(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 298 */     Ti_normal_biz ti_normal_biz = new Ti_normal_biz();
/* 299 */     String pkid_string = map.getString("pkid");
/* 300 */     String state_code = map.getString("up_operating");
/* 301 */     String remark = map.getString("remark");
/* 302 */     ti_normal_biz.setState_code(state_code);
/* 303 */     ti_normal_biz.setRemark(remark);
/* 304 */     String result_code = "0";
/*     */     try {
/* 306 */       if (!pkid_string.equals("")) {
/* 307 */         String[] pkStr = pkid_string.split("\\|");
/* 308 */         for (int i = 0; i < pkStr.length; i++)
/* 309 */           if (!pkStr[i].equals("")) {
/* 310 */             ti_normal_biz.setBiz_id(pkStr[i]);
/* 311 */             upateState(dbmMgr, ti_normal_biz);
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/* 317 */       e.printStackTrace();
/* 318 */       result_code = "1";
/*     */     }
/* 320 */     map.setString("result_code", result_code);
/* 321 */     return map;
/*     */   }
/*     */ 
/*     */   public void upateState(DbmInterf dbmMgr, Ti_normal_biz ti_normal_biz)
/*     */     throws ApplicationException
/*     */   {
/* 330 */     dbmMgr.update("upateState", ti_normal_biz);
/*     */   }
/*     */ 
/*     */   public SysMap upateEdit_date(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 335 */     Ti_normal_biz ti_normal_biz = new Ti_normal_biz();
/* 336 */     String pkid_string = map.getString("pkid");
/*     */ 
/* 338 */     String result_code = "0";
/*     */     try {
/* 340 */       if (!pkid_string.equals("")) {
/* 341 */         String[] pkStr = pkid_string.split("\\|");
/* 342 */         for (int i = 0; i < pkStr.length; i++) {
/* 343 */           if (!pkStr[i].equals(""))
/* 344 */             upateEdit_date(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/* 350 */       e.printStackTrace();
/* 351 */       result_code = "1";
/*     */     }
/* 353 */     map.setString("result_code", result_code);
/* 354 */     return map;
/*     */   }
/*     */   public void upateEdit_date(DbmInterf dbmMgr, String biz_id) throws ApplicationException {
/* 357 */     dbmMgr.update("upateEdit_date", biz_id);
/*     */   }
/*     */   public List getListBypath(String id) {
/* 360 */     return this.queryList.getList("getTi_normal_bizBypath", id);
/*     */   }
/*     */   public List getListBycompany(String biz_id) {
/* 363 */     return this.queryList.getList("getTi_normal_bizBycompany", biz_id);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_normal_biz.Ti_normal_bizInfo
 * JD-Core Version:    0.6.0
 */